#!/bin/sh

AB_PATH="/usr/qnx630/host/qnx6/x86/usr/photon/appbuilder"
AB_INC_PATH="/usr/qnx630/target/qnx6/usr/include"
AB_LIB_PATH="/usr/qnx630/target/qnx6/x86/usr/lib"
WG_PATH="/proj4/CwTrend"
WG_NAME="CwTrend"

cp $WG_PATH/x86/so/lib$WG_NAME.so 		$AB_LIB_PATH/lib$WG_NAME.so.1
ln -sf $AB_LIB_PATH/lib$WG_NAME.so.1	$AB_LIB_PATH/lib$WG_NAME.so
ln -sf $AB_LIB_PATH/lib$WG_NAME.so.1	/usr/lib/lib$WG_NAME.so
ln -sf $AB_LIB_PATH/lib$WG_NAME.so.1	/usr/lib/lib$WG_NAME.so.1

cp $WG_PATH/$WG_NAME.h					$AB_INC_PATH/photon/
cp $WG_PATH/template/$WG_NAME.pal 		$AB_PATH
cp $WG_PATH/template/$WG_NAME 			$AB_PATH/templates/
cp $WG_PATH/template/$WG_NAME.img 		$AB_PATH/templates/	

cd $AB_PATH

grep -q -e $WG_NAME abpal.def
if test $? -ne 0; 
	then
   	echo CwWidgets,$WG_NAME,1,$WG_NAME,555,217,217,217 >> abpal.def
fi

grep -q -e $WG_NAME palette.def
if test $? -ne 0; 
 	then
   	echo "l=$WG_NAME,<photon/$WG_NAME.h>:ph" >> palette.def
   	echo "p=$WG_NAME,$WG_NAME Widget" >> palette.def
fi

exit 0